export default (fun, time) => {
  let timer
  return function () {
    clearTimeout(timer)
    timer = setTimeout(() => {
      fun.apply(this, arguments)
    }, time)
  }
}
